package com.xiaoma.pattern.singleton;

/**
 * 饿汉模式
 * @author maj
 * @ClassName Hungry
 * @Description
 * @date 2020-12-02 19:56
 */
public class Hungry {

  private Hungry() {
  }

  // 类加载的时候就实例化，并且创建单例对象
  private static final Hungry hungry = new Hungry();

  public static Hungry getInstance() {
    return hungry;
  }

}
